This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 2, 2015, 2:20 PM
13 Posts

Error Message control not working for FileUpload control validation

  • Category: Other
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 3

Hello,

I am trying to use Error Message control for fileupload control validation to display "Attachment is required" (at this time no file type validation required). But error message control not populating error msg if no file uploaded. The steps i followed:
1. In Error Message control (message1), Show error message for selected "fileUpload1" .
2. In fileUpload1 control, selected required field and required field error message as "Attachment is required"
3. In fileUpload1 control, distableClientSideValidation is True.

I followed the above steps for other regular fields the validation works but why not for fileupload control. Help on this

Mar 2, 2015, 5:38 PM
13 Posts
How to use

Thanks for Reply !!

 

I can use below code but not a formula bcoz i have multiple attachment field (RTs)

if( document1.getAttachmentList("Body").isEmpty() ){
    var msg = new javax.faces.application.FacesMessage("No File added!");
    facesContext.addMessage( "No File!", msg );
    return false;
}

 

But the above code didn't work. Do i need to design a facet to work or Error message control is okay. Please tell me the process

Mar 2, 2015, 11:02 PM
110 Posts
For the code you're using...

It must be used together with the Error Messages control (the one that can show errors from multiple different controls).

And also from the link that I suggested, you cannot seem to use a "Submit" button. You have to use just a normal button to do the document save. In your case, just put document1.save() after the if statement.


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal